{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="{% static 'jQuery/jquery.min.js' %}"></script>
    <script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
    <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">
    <script src="{% static 'sweetalert.min.js' %}"></script>
</head>
<style>
    body {
        margin: 0;
    }

    th, .list-group-item, .panel-heading {
        border: 1px solid #ddd;
        text-align: center;
        height: 50px;
        line-height: 35px;
    }

    td, th {
        text-align: center;
    }

    td > button, td > form {
        display: inline-block;
    }
</style>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url 'home' %}">BookSystem</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a href="{% url 'home' %}">图书资源网站 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">小说作者网站</a></li>
                <li><a href="#">出版社网站</a></li>
            </ul>
            <form class="navbar-form navbar-left" method="get" action="{{ url }}">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="搜索" name="wd">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">注册</a></li>
                <li><a href="#">登录</a></li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-2">
            <div class="list-group">
                <a href="#" class="list-group-item active">
                    操作指南
                </a>
                <a href="{% url 'book_detail' %}" class="list-group-item">图书页面</a>
                <a href="{% url 'author_detail' %}" class="list-group-item">作者页面</a>
                <a href="{% url 'publish_detail' %}" class="list-group-item">出版社页面</a>
            </div>
        </div>
        <div class="col-md-10">
            {% block content_main %}
                <div class="panel panel-warning">
                    <div class="panel-heading">
                        <h3 class="panel-title">图书管理系统展示</h3>
                    </div>
                    <div class="panel-body text-center">
                        <h1>世界上最大的图书平台!</h1>
                        <p><a class="btn btn-primary btn-lg" href="https://www.qidian.com/" role="button"
                              target="_blank">快来了解吧!</a></p>

                        <div class="row">
                            {% for data in book_date %}
                                <div class="col-sm-4 col-md-4">
                                    <div class="thumbnail">
                                        <img src="{{ data.cover }}">
                                        <div class="caption">
                                            <h3>{{ data.title }}</h3>
                                            <strong>
                                            {% for foo in data.author.all %}
                                                {% if forloop.last %}
                                                    {{ foo.name }}
                                                {% else %}
                                                    {{ foo.name }},
                                                {% endif %}
                                            {% endfor %}
                                            </strong>
                                            <p>{{ data.desc }}</p>
                                            <p><a href="{{ data.link }}" class="btn btn-primary" role="button"
                                                  target="_blank">详情</a></p>
                                        </div>
                                    </div>
                                </div>
                            {% endfor %}
                        </div>


                    </div>
                </div>
            {% endblock %}
        </div>
    </div>
</div>

</body>
</html>